package com.example.newinfinity.View.DrawShape

import android.graphics.Canvas
import android.graphics.Paint
import android.graphics.Path

//画圆
class CircleShape() : Shape() {
    override fun draw(canvas: Canvas) {
        //绘制椭圆
        canvas.drawOval(rectF,mPaint)

        //继承父类 拖拉点拽状态为selected时显示边框及四个拖拉圆点
        super.draw(canvas)
    }

    override fun fillColor() {
        //填充时画笔模式修改为fill
        mPaint.style = Paint.Style.FILL
        super.fillColor()
    }

    override fun containsPointInPath(x: Float, y: Float): Boolean {
        mPath.addOval(rectF, Path.Direction.CW)
        return super.containsPointInPath(x, y)
    }
}